package com.baizhi.controller;

import com.baizhi.service.PmsBrandService;
import com.baizhi.vo.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.constraints.Digits;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;

/**
 * @author yu
 */
@RestController
@Validated
public class PmsBrandController {
    @Autowired
    private PmsBrandService pmsBrandService;

    @GetMapping("/brands/{categoryId}")
    public R showBrandsByCategoryId(@Max (value = 777) @PathVariable("categoryId") Long categoryId){
        R r = pmsBrandService.showPmsBrandByCategoryId(categoryId);
        return r;
    }
}
